package WarTug;

import java.util.ArrayList;

public class UnitTreeOfLife extends SimpleUnit{
	public UnitTreeOfLife() {};
	public UnitTreeOfLife(int allegiance){
		unitType = UnitType.treeOfLife;
		if (allegiance == 0) {
			xPos = 16;
			yPos = 96;
		} else {
			xPos = GraphicsManager.WINDOW_WIDTH-16;
			yPos = 96;
		}
		maxHP = 5000;
		curHP = maxHP;
		xSpeed = 0;
		ySpeed = 0;
		uid = maxUID;
		maxUID++;
		isAttacking = false;
		isDead = false;
		agroRange = 0;
		damage = 0;
		attackCoolDown = 500000;
		timeSinceLastAttack = 0;
		this.unitAllegiance = allegiance;
		this.HEIGHT = 192;
		WIDTH = 32;
		if (allegiance == 1) {
			WIDTH = -WIDTH;
		}
	}
	
	@Override
	public void modify(SimpleUnit other) {
		//Only need to update the HP and isDead of the tree. 
		this.curHP = other.curHP;
		this.isDead = other.isDead;
	}
	
	@Override
	public void move(long delta){
		//Trees don't move
		return;
	}
	
	@Override
	public void doLogic(long delta, ArrayList<SimpleUnit> allUnits){
		//Trees don't do anything
		return;
	}
}
